﻿using SqlSugar;
using System;
using System.Collections.Generic;

namespace IdentityServer4.SqlSugarCore.Entities
{
    [SugarTable("IdentityResources")]
    public class IdentityResource
    {
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
        public int Id { get; set; }
        public bool Enabled { get; set; } = true;
        public string Name { get; set; }
        public string DisplayName { get; set; }
        public string Description { get; set; }
        public bool Required { get; set; }
        public bool Emphasize { get; set; }
        public bool ShowInDiscoveryDocument { get; set; } = true;

        [SugarColumn(IsIgnore = true)]
        public List<IdentityClaim> UserClaims { get; set; }

        [SugarColumn(IsIgnore = true)]
        public List<IdentityResourceProperty> Properties { get; set; }
        public DateTime Created { get; set; } = DateTime.UtcNow;
        public DateTime? Updated { get; set; }
        public bool NonEditable { get; set; }
    }
}
